package com.session01;

public class Test {
    public static void main(String[] args) {
        arrayCodeTest();
        System.out.println("");

        //0-10的整数
        System.out.println(Math.round(mathTest() * 10));

        //退出
        //System.exit(0);

        //强制转换针对同类型，基础类型对基础类型，引用类型对引用类型

        String s = "123";
        int a = Integer.parseInt(s);
    }

    public static void arrayCodeTest() {
        int[] a = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
        int[] b = new int[10];
        System.arraycopy(a, 0, b, 1, 3);
        for (int element : b) {
            System.out.print(element + " ");
        }
    }

    public static double mathTest() {
        return Math.random();
    }
}
